package cn.wanho.util;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author Zxy
 * @Date 2022/8/5 9:08
 * @Version 1.0
 * 监听类，用于读取excel表格
 */
public class TemplateListener extends AnalysisEventListener<TemplateEntity> {
    private List<TemplateEntity> list = new ArrayList<>();
    //读取数据，添加到集合中
    @Override
    public void invoke(TemplateEntity data, AnalysisContext analysisContext) {
        list.add(data);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
    public List<TemplateEntity> getData(){
        return list;
    }
}
